//
//  SmsCloudMainNavView.m
//  smsCloud
//
//  Created by 蓝鳍互娱 on 2024/7/19.
//

#import "SmsCloudMainNavView.h"
@interface SmsCloudMainNavView()
@property (nonatomic,strong)UILabel * smsCloudMainTitleLab;
@end
@implementation SmsCloudMainNavView
-(instancetype)init{
    if (self == [super init]) {
        [self smsCloudInitView];
    }
    return self;
}
- (void)smsCloudInitView{
    UIButton * smsCloudMainBackBtn = [[UIButton alloc] init];
    [smsCloudMainBackBtn setBackgroundImage:[SmsCloudHead SmsCloudImageNamed:@"smsCloudNavBlackBack"] forState:UIControlStateNormal];
    [smsCloudMainBackBtn addTarget:self action:@selector(smsCloudMainBack) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:smsCloudMainBackBtn];
    [smsCloudMainBackBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@([SmsCloudHead SmsCloudScreewRatio:24]));
        make.top.equalTo(@([SmsCloudHead SmsCloudScreewRatio:22] + [SmsCloudHead SmsCloudTopSafeH]));
        make.width.equalTo(@([SmsCloudHead SmsCloudScreewRatio:64]));
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:64]));
    }];
    self.smsCloudMainTitleLab = [[UILabel alloc] init];
    self.smsCloudMainTitleLab.textColor = [SmsCloudHead SmsCloudColorHexString:@"#000000"];
    self.smsCloudMainTitleLab.font = [UIFont systemFontOfSize:[SmsCloudHead SmsCloudScreewRatio:34] weight:UIFontWeightRegular];
    
    [self addSubview:self.smsCloudMainTitleLab];
    [self.smsCloudMainTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(smsCloudMainBackBtn);
        make.centerX.equalTo(self);
        make.height.equalTo(@([SmsCloudHead SmsCloudScreewRatio:50]));
    }];
}
-(void)setSmsCloudNavTitle:(NSString *)smsCloudNavTitle{
    _smsCloudNavTitle = smsCloudNavTitle;
    self.smsCloudMainTitleLab.text = _smsCloudNavTitle;
}
- (void)smsCloudMainBack{
    if(self.SmsCloudMainBackBlock){
        self.SmsCloudMainBackBlock();
    }
}
@end
